#pragma once
#include "ui_MainWindow.h"
#include <QScopedPointer>

namespace kryptos { namespace ui {

class MainWindow : public QWidget
{
    Q_OBJECT
private:

    enum ActionType { Encrypt, Decrypt, Delete, KeyManager};

public:
    explicit MainWindow(QWidget *parent = 0);

private slots:

    void bringToFront();
    void actionSelected(int action);
    void hideActionWidget();

private:
    template<class T> void createActionWidget(QSize size);
    void initEncryptionWidget();
    void initDecryptionWidget();
    void initKeyManagerWidget();

    Ui::MainWindow ui;

    bool                          m_firstShow;
    QButtonGroup                  m_menuButtonGroup;
    QScopedPointer<QWidget>       m_currentActionWidget;
    QSize                         m_originalSize, m_containerOriginalSize;
    ActionType                    m_activeAction;
};

}}
